Skip to content

Conversation

uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Sep 11, 2025

Description

Use the Ollama configured default context length of 4096 (instead of Continue's 32,768).

resolves CON-3817

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

before

image

after

image

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Use Ollama’s actual context length: we now default to 4096 (Ollama’s config) and use the model-provided value when available, instead of Continue’s 32,768. This prevents overestimating the token window and aligns with CON-3817.

  • Bug Fixes
    • Added a contextLength getter that returns the detected model value, or 4096 as fallback.
    • Replaces the incorrect 32,768 default to avoid overflow and truncation issues.

@uinstinct uinstinct requested a review from a team as a code owner September 11, 2025 05:59
@uinstinct uinstinct requested review from RomneyDa and removed request for a team September 11, 2025 05:59
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 11, 2025
@RomneyDa
Copy link
Collaborator

4096 might be a bit too restrictive, wondering if we should do 8192

@uinstinct
Copy link
Contributor Author

4096 might be a bit too restrictive, wondering if we should do 8192

We can do it. It would take around 20% more memory in 8192 (attached image below).

image

Wondering if it would concern the users? Or should we put a user facing setting which can configure this num_ctx parameter (it also helps users know its changeable)?

@RomneyDa
Copy link
Collaborator

I think 20% is fine, 4096 makes sense for text in text out but for an agent application it's too restrictive

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 17, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 17, 2025
@RomneyDa RomneyDa merged commit 12aad2e into continuedev:main Sep 17, 2025
83 of 85 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Sep 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2025
@uinstinct uinstinct deleted the ollama-memory-contextlength branch September 18, 2025 02:54
@sestinj
Copy link
Contributor

sestinj commented Sep 18, 2025

🎉 This PR is included in version 1.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Sep 19, 2025

🎉 This PR is included in version 1.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer released size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants